package lianxi1;

public class studenttest {
	public static void main(String args[]) {
		studentclass sc = new studentclass();
		studentmen sm = new studentmen();
		studentclass sc1 = new studentmen();
		sc.set("王浩", "1", "男");
		sc.set(90.5);
		sm.set("张杰", "2", "男");
		sm.set(99.0);
		sm.set("班长");
		System.out.println(sc.toString());
		System.out.println(sm.toString());
		sc1.set("赵丽", "3", "女");
		sc1.set(100);
		System.out.println(sc1.toString());
	}

}

class studentclass{
	String name;
	String code;
	String sexy;
	double achievement;
	public void set(String name, String code, String sexy) {
		this.name = name;
		this.code = code;
		this.sexy = sexy;
	}
	public void set(double achievement) {
		this.achievement = achievement;
	}
	public String getname() {
		return name;
	}
	public String getcode() {
		return code;
	}
	public String getsexy() {
		return sexy;
	}
	public double getachievement() {
		return achievement;
	}
	public String toString() {
		String infor = "学生姓名:" + name + " 学号:" + code + " 性别:" + sexy + " 成绩:" + achievement;
		return infor;
	}
}

class studentmen extends studentclass{
	private String duty;
	public void set(String duty) {
		this.duty = duty;
	}
	public String getduty() {
		return duty;
	}
	public String toString() {
		String infor = "学生姓名:" + name + " 学号:" + code + " 性别:" + sexy + " 职务:" + duty + " 成绩:" + achievement;
		return infor;
	}
}